package com.share.core.util;

import com.share.core.service.ExampleService;

import java.sql.SQLException;

/**
 * @author caifan
 * @created 2021/8/11
 * description:
 */
public final class ExampleExecuteTemplate {
    public static void run(final ExampleService exampleService) throws SQLException {
        try {
            exampleService.initEnvironment();
            exampleService.processSuccess();
        } finally {
//            exampleService.cleanEnvironment();
        }
    }

    public static void runFailure(final ExampleService exampleService) throws SQLException {
        try {
            exampleService.initEnvironment();
            exampleService.processFailure();
        } finally {
            exampleService.cleanEnvironment();
        }
    }
}
